<template>
  <div class="send_letter">
    <Header title="发送私信" go-back="true"></Header>
    <div class="send_textbox">
      <textarea v-model="msg" name="" id="" rows="5" placeholder="写下你的小秘密吧......"></textarea>
      <div class="send_btn">
        <button @click="sendBtn">发送</button>
      </div>
    </div>
  </div>
</template>

<script>
import Header from '../../Header/Header'
import {sendText} from '../../../api/node'
import {Toast} from 'mint-ui'

export default {
  name: 'Child4Page3',
  data () {
    return {
      msg: ''
    }
  },
  methods: {
    sendBtn () {
      sendText(this.msg).then(res => {
        // console.log(res)
        if (res.code === 200) {
          console.log(res)
        } else if (res.code === 301) {
          Toast({
            message: res.msg,
            position: 'middle',
            duration: 1500
          })
          return false
        }
      })
    }
  },
  components: {
    Header
  }
}
</script>

<style lang="scss" scoped>
.send_letter{
  width: 100%;
  padding-top: 50px;
  .send_textbox{
    width: 100%;
    padding: 10px;
    textarea{
      width: 100%;
      padding: 10px;
      outline: none;
    }
    .send_btn{
      text-align: right;
      button{
        width: 80px;
        height: 30px;
        outline: none;
        border: none;
        background: #e44121;
        color: #fff;
        font-size: 15px;
        border-radius: 5px;
        box-shadow: 1px 2px 3px #888;
      }
    }
  }
}
</style>
